; Music of Mission Omega (1986) (Mind Games)
; Ripped by Megachur the 02/11/2006

	write "MISSIONO.BIN"

music_date_rip	equ &02b6
music_adr	equ &4200
first_theme	equ 1
last_theme	equ 1

	read "music_header_v1_0.asm"

.l4200
	push af
	xor a
	ld (l43e1),a
	ld (l4783),a
	ld (l4785),a
	pop af
	sla a
	ld d,#00
	ld e,a
	ld hl,l4348
	add hl,de
	ld a,(hl)
	inc hl
	ld h,(hl)
	ld l,a
	ld b,#0f
	ld de,l43e3
.l421e
	ld a,(hl)
	ld (de),a
	inc hl
	inc de
	djnz l421e
	ld a,(l43e4)
	ld (l43f2),a
	ld a,(l477a)
	or #2d
	ld hl,l43ea
	and (hl)
	ld (l477a),a
	ld b,a
	ld c,#07
	call l4f0b
	ld hl,(l43e5)
	ld (l43f4),hl
	ld de,(l43e7)
	ld (l43f6),de
	ld b,l
	ld c,#06
	call l4f0b
	ld c,#00
	call l4f0b
	ld b,h
	inc c
	call l4f0b
	ld b,e
	inc c
	inc c
	inc c
	call l4f0b
	ld b,d
	inc c
	call l4f0b
	ld bc,#000b
	call l4f0b
	ld a,(l43e9)
	ld b,a
	inc c
	call l4f0b
	ld b,#10
	ld c,#08
	call l4f0b
	inc c
	inc c
	call l4f0b
	ld b,#00
	ld c,#0d
	call l4f0b
	ld hl,l43e1
	inc (hl)
	ret
.l428c
	ld a,(l43e3)
	and a
	jp z,l4324
	dec a
	ld (l43e3),a
	ld a,(l43f2)
	and a
	jr nz,l42b8
	ld a,(l43f1)
	and a
	ret z
	dec a
	ld (l43f1),a
	ld a,(l43e4)
	ld (l43f2),a
	ld hl,(l43e5)
	ld (l43f4),hl
	ld hl,(l43e7)
	ld (l43f6),hl
.l42b8
	ld hl,l43f2
	dec (hl)
	ld a,(l43ef)
	and a
	jr z,l42df
	jp p,l42d2
	ld hl,(l43f4)
	ld de,(l43eb)
	add hl,de
	ld (l43f4),hl
	jr l42df
.l42d2
	ld hl,(l43f4)
	ld de,(l43eb)
	and a
	sbc hl,de
	ld (l43f4),hl
.l42df
	ld a,(l43f0)
	and a
	jr z,l4302
	jp p,l42f5
	ld hl,(l43f6)
	ld de,(l43ed)
	add hl,de
	ld (l43f6),hl
	jr l4302
.l42f5
	ld hl,(l43f6)
	ld de,(l43ed)
	and a
	sbc hl,de
	ld (l43f6),hl
.l4302
	ld hl,(l43f4)
	ld b,l
	ld c,#06
	call l4f0b
	ld c,#00
	call l4f0b
	ld b,h
	inc c
	call l4f0b
	ld hl,(l43f6)
	ld b,l
	inc c
	inc c
	inc c
	call l4f0b
	ld b,h
	inc c
	jp l4f0b
.l4324
	ld (l43e1),a
	inc a
	ld (l4783),a
	ld (l4785),a
	ld a,(l477a)
	or #2d
	ld (l477a),a
	ld b,a
	ld c,#07
	call l4f0b
	ld b,#00
	inc c
	call l4f0b
	inc c
	inc c
	call l4f0b
	ret
.l4348
	dw l435a,l4369,l4378,l4387
	dw l4396,l43a5,l43b4,l43c3
	dw l43d2
.l435a
	db #14,#15,#80,#00,#a8,#00,#0f,#f2
.l4369 equ $ + 7
	db #19,#00,#1b,#00,#ff,#ff,#00,#14
	db #05,#80,#01,#a8,#01,#0f,#fa,#23
.l4378 equ $ + 6
	db #00,#28,#00,#01,#01,#05,#02,#02
	db #80,#00,#81,#00,#02,#fa,#00,#00
.l4387 equ $ + 5
	db #00,#00,#00,#00,#00,#64,#08,#80
	db #00,#87,#00,#28,#d2,#23,#00,#28
.l4396 equ $ + 4
	db #00,#ff,#ff,#14,#32,#06,#0a,#00
	db #0f,#00,#14,#d2,#03,#00,#04,#00
.l43a5 equ $ + 3
	db #ff,#01,#0a,#14,#06,#28,#00,#2b
	db #00,#0f,#fa,#20,#20,#20,#20,#ff
.l43b4 equ $ + 2
	db #ff,#06,#63,#63,#00,#00,#01,#00
	db #28,#d2,#01,#40,#01,#40,#ff,#ff
.l43c3 equ $ + 1
	db #00,#5a,#5a,#00,#00,#01,#00,#28
	db #d2,#01,#40,#01,#40,#01,#01,#00
.l43d2
	db #1e,#0f,#00,#0a,#0a,#0a,#14,#fa
	db #20,#00,#21,#00,#ff,#ff,#00
.l43e7 equ $ + 6
.l43e5 equ $ + 4
.l43e4 equ $ + 3
.l43e3 equ $ + 2
.l43e2 equ $ + 1
.l43e1
	db #00,#00,#00,#00,#00,#00,#00,#00
.l43f0 equ $ + 7
.l43ef equ $ + 6
.l43ed equ $ + 4
.l43eb equ $ + 2
.l43ea equ $ + 1
.l43e9
	db #00,#00,#00,#00,#00,#00,#00,#00
.l43f6 equ $ + 5
.l43f4 equ $ + 3
.l43f2 equ $ + 1
.l43f1
	db #00,#00,#00,#00,#00,#00,#00
;
.init_music	; .l43f8 a=1(main theme)
;
	ld (l4781),a
	xor a
	ld (l4782),a
	ld (l43e1),a
	ld (l47bf),a
	inc a
	ld (l47c2),a
	ld (l47c1),a
	ld (l47c3),a
	ld (l47c4),a
	ld a,(l4781)
	ld b,a
	ld a,#fa
.l4418
	add #06
	dec b
	jr nz,l4418
	ld d,#00
	ld e,a
	ld hl,l47ec
	add hl,de
	ld a,(hl)
	ld (l480a),a
	ld (l4810),a
	inc hl
	ld a,(hl)
	ld (l480b),a
	ld (l4811),a
	inc hl
	ld a,(hl)
	ld (l480c),a
	ld (l4812),a
	inc hl
	ld a,(hl)
	ld (l480d),a
	ld (l4813),a
	inc hl
	ld a,(hl)
	ld (l480e),a
	ld (l4814),a
	inc hl
	ld a,(hl)
	ld (l480f),a
	ld (l4815),a
	ld a,(l4781)
	cp #04
	jr nc,l446c
	ld hl,(l47ec)
	ld (l4810),hl
	ld hl,(l47ee)
	ld (l4812),hl
	ld hl,(l47f0)
	ld (l4814),hl
.l446c
	call l4816
	call l4823
	call l4830
	ld a,#03
	ld (l478d),a
	ld (l478e),a
	call l449b
	xor a
	ld hl,l478f
	ld (hl),a
	ld de,l4790
	ld bc,#0008
	ldir
	inc a
	ld (l4783),a
	ld (l4784),a
	ld (l4785),a
	ld (l4782),a
	ret
.l449b
	ld b,#00
	ld c,#0d
.l449f
	call l4f0b
	dec c
	jp p,l449f
	ld b,#3f
	ld a,b
	ld (l477a),a
	ld c,#07
	call l4f0b
	ret
;
.play_music	;.l44b2
;
	ld a,(l43e1)
	and a
	call nz,l428c
	ld a,(l4782)
	and a
	ret z
	call l483d
	call l4956
	call l4a00
	ld hl,l478e
	dec (hl)
	ret nz
	ld a,(l478d)
	ld (hl),a
	ld a,(l478f)
	and a
	jp nz,l45b7
	ld (l47ca),a
	ld (l4795),a
	ld (l47b9),a
	ld a,(l4798)
	and #f0
	ld (l47b0),a
	ld a,(l479b)
	and #f0
	ld (l47b3),a
	ld hl,#0000
	ld (l4786),hl
	ld hl,#0000
	ld (l4788),hl
	ld a,#01
	ld (l47bc),a
.l4501
	ld hl,#0000
	ld (l477b),hl
.l4507
	ld hl,(l47a4)
	ld (l477d),hl
	ld de,(l477b)
	add hl,de
	ld a,(hl)
	cp #7f
	jr nz,l4531
	ld hl,(l480a)
	inc hl
	inc hl
	ld (l480a),hl
.l451f
	call l4816
	ld hl,(l47a4)
	ld a,h
	or l
	jr nz,l4501
	ld hl,(l4810)
	ld (l480a),hl
	jr l451f
.l4531
	cp #80
	jr c,l455a
	ld hl,l477b
	inc (hl)
	and #7f
	cp #20
	jr c,l4544
	call l49a4
	jr l4507
.l4544
	add a
	ld e,a
	ld d,#00
	ld hl,l496e
	add hl,de
	ld a,(hl)
	ld (l4556),a
	inc hl
	ld a,(hl)
	ld (l4557),a
.l4557 equ $ + 2
.l4556 equ $ + 1
	call l4200
	jr l4507
.l455a
	push af
	ld a,(l47a1)
	ld (l478f),a
	pop af
	ld (l47c7),a
	call l4f32
	ld a,(l4783)
	and a
	jr z,l45a8
	ld b,#00
	ld c,#08
	call l4f0b
	ld a,(l47cb)
	ld b,a
	ld c,#06
	call l4f0b
	ld hl,l47c5
	ld b,(hl)
	ld a,b
	ld (l47aa),a
	ld c,#00
	call l4f0b
	inc hl
	ld b,(hl)
	ld a,b
	ld (l47ad),a
	ld c,#01
	call l4f0b
	ld a,(l477a)
	or #09
	ld hl,l478a
	and (hl)
	ld (l477a),a
	ld b,a
	ld c,#07
	call l4f0b
.l45a8
	ld hl,l477b
	inc (hl)
	ld hl,(l47a4)
	ld de,(l477b)
	add hl,de
	ld (l47a4),hl
.l45b7
	ld hl,l478f
	dec (hl)
	ld a,(l4790)
	and a
	jp nz,l4696
	ld (l4796),a
	ld (l47ba),a
	ld a,(l4799)
	and #f0
	ld (l47b1),a
	ld a,(l479c)
	and #f0
	ld (l47b4),a
	ld hl,#0001
	ld (l4786),hl
	ld hl,#0002
	ld (l4788),hl
	ld a,#01
	ld (l47bd),a
.l45e9
	ld hl,#0000
	ld (l477b),hl
.l45ef
	ld hl,(l47a6)
	ld (l477d),hl
	ld de,(l477b)
	add hl,de
	ld a,(hl)
	cp #7f
	jr nz,l4619
	ld hl,(l480c)
	inc hl
	inc hl
	ld (l480c),hl
.l4607
	call l4823
	ld hl,(l47a6)
	ld a,h
	or l
	jr nz,l45e9
	ld hl,(l4812)
	ld (l480c),hl
	jr l4607
.l4619
	cp #80
	jr c,l4642
	ld hl,l477b
	inc (hl)
	and #7f
	cp #20
	jr c,l462c
	call l49a4
	jr l45ef
.l462c
	add a
	ld e,a
	ld d,#00
	ld hl,l496e
	add hl,de
	ld a,(hl)
	ld (l463e),a
	inc hl
	ld a,(hl)
	ld (l463f),a
.l463f equ $ + 2
.l463e equ $ + 1
	call l4200
	jr l45ef
.l4642
	push af
	ld a,(l47a2)
	ld (l4790),a
	pop af
	ld (l47c8),a
	call l4f32
	ld a,(l4784)
	and a
	jr z,l4687
	ld b,#00
	ld c,#09
	call l4f0b
	ld hl,l47c5
	ld b,(hl)
	ld a,b
	ld (l47ab),a
	ld c,#02
	call l4f0b
	inc hl
	ld b,(hl)
	ld a,b
	ld (l47ae),a
	ld c,#03
	call l4f0b
	ld a,(l477a)
	or #12
	ld hl,l478b
	and (hl)
	ld (l477a),a
	ld b,a
	ld c,#07
	call l4f0b
.l4687
	ld hl,l477b
	inc (hl)
	ld hl,(l47a6)
	ld de,(l477b)
	add hl,de
	ld (l47a6),hl
.l4696
	ld hl,l4790
	dec (hl)
	ld a,(l4791)
	and a
	jp nz,l4775
	ld (l4797),a
	ld (l47bb),a
	ld a,(l479a)
	and #f0
	ld (l47b2),a
	ld a,(l479d)
	and #f0
	ld (l47b5),a
	ld hl,#0002
	ld (l4786),hl
	ld hl,#0004
	ld (l4788),hl
	ld a,#01
	ld (l47be),a
.l46c8
	ld hl,#0000
	ld (l477b),hl
.l46ce
	ld hl,(l47a8)
	ld (l477d),hl
	ld de,(l477b)
	add hl,de
	ld a,(hl)
	cp #7f
	jr nz,l46f8
	ld hl,(l480e)
	inc hl
	inc hl
	ld (l480e),hl
.l46e6
	call l4830
	ld hl,(l47a8)
	ld a,h
	or l
	jr nz,l46c8
	ld hl,(l4814)
	ld (l480e),hl
	jr l46e6
.l46f8
	cp #80
	jr c,l4721
	ld hl,l477b
	inc (hl)
	and #7f
	cp #20
	jr c,l470b
	call l49a4
	jr l46ce
.l470b
	add a
	ld e,a
	ld d,#00
	ld hl,l496e
	add hl,de
	ld a,(hl)
	ld (l471d),a
	inc hl
	ld a,(hl)
	ld (l471e),a
.l471e equ $ + 2
.l471d equ $ + 1
	call l4200
	jr l46ce
.l4721
	push af
	ld a,(l47a3)
	ld (l4791),a
	pop af
	ld (l47c9),a
	call l4f32
	ld a,(l4785)
	and a
	jr z,l4766
	ld b,#00
	ld c,#0a
	call l4f0b
	ld hl,l47c5
	ld b,(hl)
	ld a,b
	ld (l47ac),a
	ld c,#04
	call l4f0b
	inc hl
	ld b,(hl)
	ld a,b
	ld (l47af),a
	ld c,#05
	call l4f0b
	ld a,(l477a)
	or #24
	ld hl,l478c
	and (hl)
	ld (l477a),a
	ld b,a
	ld c,#07
	call l4f0b
.l4766
	ld hl,l477b
	inc (hl)
	ld hl,(l47a8)
	ld de,(l477b)
	add hl,de
	ld (l47a8),hl
.l4775
	ld hl,l4791
	dec (hl)
	ret
.l4781 equ $ + 7
.l477d equ $ + 3
.l477b equ $ + 1
.l477a
	db #00,#00,#00,#00,#00,#00,#00,#01
.l4788 equ $ + 6
.l4786 equ $ + 4
.l4785 equ $ + 3
.l4784 equ $ + 2
.l4783 equ $ + 1
.music_end
.l4782
	db #00,#00,#00,#00,#00,#00,#00,#00
.l4791 equ $ + 7
.l4790 equ $ + 6
.l478f equ $ + 5
.l478e equ $ + 4
.l478d equ $ + 3
.l478c equ $ + 2
.l478b equ $ + 1
.l478a
	db #00,#00,#00,#00,#00,#00,#00,#00
.l4799 equ $ + 7
.l4798 equ $ + 6
.l4797 equ $ + 5
.l4796 equ $ + 4
.l4795 equ $ + 3
	db #00,#00,#00,#00,#00,#00,#00,#00
.l47a1 equ $ + 7
.l47a0 equ $ + 6
.l479f equ $ + 5
.l479e equ $ + 4
.l479d equ $ + 3
.l479c equ $ + 2
.l479b equ $ + 1
.l479a
	db #00,#00,#00,#00,#00,#00,#00,#00
.l47a9 equ $ + 7
.l47a8 equ $ + 6
.l47a7 equ $ + 5
.l47a6 equ $ + 4
.l47a5 equ $ + 3
.l47a4 equ $ + 2
.l47a3 equ $ + 1
.l47a2
	db #00,#00,#00,#00,#00,#00,#00,#00
.l47b1 equ $ + 7
.l47b0 equ $ + 6
.l47af equ $ + 5
.l47ae equ $ + 4
.l47ad equ $ + 3
.l47ac equ $ + 2
.l47ab equ $ + 1
.l47aa
	db #00,#00,#00,#00,#00,#00,#00,#00
.l47b9 equ $ + 7
.l47b8 equ $ + 6
.l47b7 equ $ + 5
.l47b6 equ $ + 4
.l47b5 equ $ + 3
.l47b4 equ $ + 2
.l47b3 equ $ + 1
.l47b2
	db #00,#00,#00,#00,#00,#00,#00,#00
.l47c1 equ $ + 7
.l47c0 equ $ + 6
.l47bf equ $ + 5
.l47be equ $ + 4
.l47bd equ $ + 3
.l47bc equ $ + 2
.l47bb equ $ + 1
.l47ba
	db #00,#00,#00,#00,#00,#00,#00,#00
.l47c9 equ $ + 7
.l47c8 equ $ + 6
.l47c7 equ $ + 5
.l47c6 equ $ + 4
.l47c5 equ $ + 3
.l47c4 equ $ + 2
.l47c3 equ $ + 1
.l47c2
	db #00,#00,#00,#00,#00,#00,#00,#00
.l47cb equ $ + 1
.l47ca
	db #00,#00,#00,#00,#00,#00,#00,#00
.l47d4 equ $ + 2
	db #00,#00,#7c,#07,#08,#07,#b0,#06
	db #40,#06,#ec,#05,#94,#05,#44,#05
	db #f8,#04,#b0,#04,#70,#04,#2c,#04
.l47f0 equ $ + 6
.l47ee equ $ + 4
	db #f0,#03
.l47ec
	dw l4e21,l4e2b,l4ea5,l4e21
	dw l4e4b,l4eb9,l4e21,l4e83
	dw l4ee5,l4f07,l4f07,l4f07
	dw l4e21,l4e83,l4e83
.l4811 equ $ + 7
.l4810 equ $ + 6
.l480f equ $ + 5
.l480e equ $ + 4
.l480d equ $ + 3
.l480c equ $ + 2
.l480b equ $ + 1
.l480a
	db #00,#00,#00,#00,#00,#00,#00,#00
.l4815 equ $ + 3
.l4814 equ $ + 2
.l4813 equ $ + 1
.l4812
	db #00,#00,#00,#00
.l4816
	ld hl,(l480a)
	ld a,(hl)
	ld (l47a4),a
	inc hl
	ld a,(hl)
	ld (l47a5),a
	ret
.l4823
	ld hl,(l480c)
	ld a,(hl)
	ld (l47a6),a
	inc hl
	ld a,(hl)
	ld (l47a7),a
	ret
.l4830
	ld hl,(l480e)
	ld a,(hl)
	ld (l47a8),a
	inc hl
	ld a,(hl)
	ld (l47a9),a
	ret
.l483d
	ld a,(l43e2)
	xor #ff
	ld (l43e2),a
	ret z
	ld a,(l4783)
	and a
	jr z,l4861
	ld a,(l479e)
	and a
	jr z,l4861
	ld hl,#0000
	ld (l4786),hl
	ld hl,#0001
	ld (l4788),hl
	call l489a
.l4861
	ld a,(l4784)
	and a
	jr z,l487c
	ld a,(l479f)
	and a
	jr z,l487c
	ld hl,#0001
	ld (l4786),hl
	ld hl,#0003
	ld (l4788),hl
	call l489a
.l487c
	ld a,(l4785)
	and a
	jr z,l4897
	ld a,(l47a0)
	and a
	jr z,l4897
	ld hl,#0002
	ld (l4786),hl
	ld hl,#0005
	ld (l4788),hl
	call l489a
.l4897
	jp l4923
.l489a
	ld a,(l47bf)
	ld (l47c0),a
	ld de,(l4786)
	ld hl,l47c7
	add hl,de
	ld a,(hl)
	ld hl,l47c0
	cp #50
	jr nc,l48ca
	sla (hl)
	cp #40
	jr nc,l48ca
	sla (hl)
	cp #30
	jr nc,l48ca
	sla (hl)
	cp #20
	jr nc,l48ca
	sla (hl)
	cp #10
	jr nc,l48ca
	sla (hl)
.l48ca
	ld a,(l47c1)
	and a
	jp m,l48fa
	ld hl,l47aa
	ld de,(l4786)
	add hl,de
	ld (l4786),hl
	ld a,(hl)
	ld hl,l47c0
	add (hl)
	push af
	ld hl,(l4786)
	inc hl
	inc hl
	inc hl
	ld a,(hl)
	adc #00
	ld bc,(l4788)
	ld b,a
	call l4f0b
	dec c
	pop af
	ld b,a
	call l4f0b
	ret
.l48fa
	ld hl,l47aa
	ld de,(l4786)
	add hl,de
	ld (l4786),hl
	ld a,(hl)
	ld hl,l47c0
	sub (hl)
	push af
	ld hl,(l4786)
	inc hl
	inc hl
	inc hl
	ld a,(hl)
	sbc #00
	ld bc,(l4788)
	ld b,a
	call l4f0b
	dec c
	pop af
	ld b,a
	call l4f0b
	ret
.l4923
	ld a,(l47c2)
	and a
	jp m,l493e
	ld de,l47bf
	ld a,(de)
	ld hl,l47c3
	add (hl)
	ld (de),a
	ld hl,l47c4
	cp (hl)
	ret nz
	ld a,#ff
	ld (l47c2),a
	ret
.l493e
	ld de,l47bf
	ld a,(de)
	ld hl,l47c3
	sub (hl)
	ld (de),a
	ret nz
	ld a,#01
	ld (l47c2),a
	ld a,(l47c1)
	xor #fe
	ld (l47c1),a
	ret
.l4956
	ld a,(l4783)
	and a
	ret z
	ld a,(l47ca)
	and a
	ret z
	ld a,(l47cb)
	xor #08
	ld (l47cb),a
	ld b,a
	ld c,#06
	jp l4f0b
.l496e
	dw #0000,#0000,#0000,#0000
	dw #0000,#0000,#0000,#0000
	dw l49c6,l499e,#0000,#0000
	dw #0000,#0000,l4b40,l4b4b
	dw #0000,#0000,l4b56,l4b68
	dw #0000,#0000,#0000,l4b7a
.l499e
	ld a,#01
	ld (l47ca),a
	ret
.l49a4
	sub #1f
	ld de,(l4786)
	ld hl,l47a1
	add hl,de
	ld (hl),a
	ret
.l49b0
	xor a
	ld (l47c5),a
	ld (l47c6),a
	ld hl,l479e
	ld de,(l4786)
	add hl,de
	ld (hl),a
	ld hl,l47bc
	add hl,de
	ld (hl),a
	ret
.l49c6
	ld hl,(l477d)
	ld de,(l477b)
	add hl,de
	ld a,(hl)
	push af
	inc hl
	inc de
	ld a,(hl)
	push af
	inc hl
	inc de
	ld a,(hl)
	inc de
	ld (l477b),de
	ld de,(l4786)
	ld hl,l47b6
	add hl,de
	ld (hl),a
	ld hl,l479b
	add hl,de
	pop af
	ld (hl),a
	ld hl,l47b3
	add hl,de
	and #f0
	ld (hl),a
	ld hl,l4798
	add hl,de
	pop af
	ld (hl),a
	ld hl,l47b0
	add hl,de
	and #f0
	ld (hl),a
	ret
.l4a00
	ld a,(l4783)
	and a
	jr z,l4a6d
	ld a,(l47bc)
	and a
	jr z,l4a6d
	ld a,(l47b9)
	and a
	jp m,l4a43
	ld a,(l47b0)
	sub #10
	ld (l47b0),a
	jr nz,l4a6d
	ld a,(l4798)
	ld b,a
	and #f0
	ld (l47b0),a
	ld a,b
	and #0f
	ld hl,l4795
	add (hl)
	ld (l4795),a
	push af
	ld b,a
	ld c,#08
	call l4f0b
	pop af
	cp #0f
	jr nz,l4a6d
	ld a,#80
	ld (l47b9),a
	jr l4a6d
.l4a43
	ld a,(l47b3)
	sub #10
	ld (l47b3),a
	jr nz,l4a6d
	ld a,(l479b)
	ld b,a
	and #f0
	ld (l47b3),a
	ld a,b
	and #0f
	ld b,a
	ld a,(l4795)
	ld hl,l47b6
	cp (hl)
	jr z,l4a6d
	sub b
	ld (l4795),a
	ld b,a
	ld c,#08
	call l4f0b
.l4a6d
	ld a,(l4784)
	and a
	jr z,l4ada
	ld a,(l47bd)
	and a
	jr z,l4ada
	ld a,(l47ba)
	and a
	jp m,l4ab0
	ld a,(l47b1)
	sub #10
	ld (l47b1),a
	jr nz,l4ada
	ld a,(l4799)
	ld b,a
	and #f0
	ld (l47b1),a
	ld a,b
	and #0f
	ld hl,l4796
	add (hl)
	ld (l4796),a
	push af
	ld b,a
	ld c,#09
	call l4f0b
	pop af
	cp #0f
	jr nz,l4ada
	ld a,#80
	ld (l47ba),a
	jr l4ada
.l4ab0
	ld a,(l47b4)
	sub #10
	ld (l47b4),a
	jr nz,l4ada
	ld a,(l479c)
	ld b,a
	and #f0
	ld (l47b4),a
	ld a,b
	and #0f
	ld b,a
	ld a,(l4796)
	ld hl,l47b7
	cp (hl)
	jr z,l4ada
	sub b
	ld (l4796),a
	ld b,a
	ld c,#09
	call l4f0b
.l4ada
	ld a,(l4785)
	and a
	ret z
	ld a,(l47be)
	and a
	ret z
	ld a,(l47bb)
	and a
	jp m,l4b18
	ld a,(l47b2)
	sub #10
	ld (l47b2),a
	ret nz
	ld a,(l479a)
	ld b,a
	and #f0
	ld (l47b2),a
	ld a,b
	and #0f
	ld hl,l4797
	add (hl)
	ld (l4797),a
	push af
	ld b,a
	ld c,#0a
	call l4f0b
	pop af
	cp #0f
	ret nz
	ld a,#80
	ld (l47bb),a
	ret
.l4b18
	ld a,(l47b5)
	sub #10
	ld (l47b5),a
	ret nz
	ld a,(l479d)
	ld b,a
	and #f0
	ld (l47b5),a
	ld a,b
	and #0f
	ld b,a
	ld a,(l4797)
	ld hl,l47b8
	cp (hl)
	ret z
	sub b
	ld (l4797),a
	ld b,a
	ld c,#0a
	jp l4f0b
.l4b40
	ld de,(l4786)
	ld hl,l479e
	add hl,de
	ld (hl),#01
	ret
.l4b4b
	ld de,(l4786)
	ld hl,l479e
	add hl,de
	ld (hl),#00
	ret
.l4b56
	ld de,(l4786)
	ld hl,l4b65
	add hl,de
	ld a,(hl)
	ld hl,l478a
	add hl,de
	ld (hl),a
	ret
.l4b65
	cp #fd
	ei
.l4b68
	ld de,(l4786)
	ld hl,l4b77
	add hl,de
	ld a,(hl)
	ld hl,l478a
	add hl,de
	ld (hl),a
	ret
.l4b77
	db #f7,#ef,#df
.l4b7a
	ld hl,(l477d)
	ld de,(l477b)
	add hl,de
	ld a,(hl)
	ld (l47cb),a
	inc de
	ld (l477b),de
	ret
.l4b8c
	db #93,#88,#1f,#13,#06,#a1,#97,#1f
	db #89,#00,#88,#1f,#13,#09,#97,#01
	db #00,#00,#00,#88,#1f,#11,#09,#a3
	db #97,#07,#89,#00,#a1,#88,#1f,#13
	db #09,#97,#01,#00,#00,#88,#1f,#13
	db #06,#97,#1f,#89,#00,#88,#1f,#13
	db #09,#97,#01,#00,#00,#00,#88,#1f
	db #11,#09,#a3,#97,#07,#89,#00,#a1
	db #88,#1f,#13,#09,#97,#01,#00,#00
.l4bd5 equ $ + 1
	db #7f,#93,#88,#1f,#13,#06,#a1,#97
	db #1f,#89,#00,#88,#1f,#13,#09,#97
	db #01,#00,#00,#00,#88,#1f,#11,#09
	db #a3,#97,#07,#89,#00,#a1,#88,#1f
	db #13,#09,#97,#1f,#89,#00,#88,#1f
	db #13,#09,#97,#01,#00,#88,#1f,#13
	db #09,#97,#1f,#89,#00,#88,#1f,#11
	db #09,#a3,#97,#07,#89,#00,#a1,#88
	db #1f,#13,#09,#97,#01,#00,#00,#00
	db #88,#1f,#11,#09,#a3,#97,#07,#89
.l4c27 equ $ + 3
	db #00,#a1,#7f,#93,#88,#1f,#13,#06
	db #a1,#97,#1f,#89,#00,#88,#1f,#13
	db #09,#97,#01,#00,#00,#00,#88,#1f
	db #11,#09,#a3,#97,#07,#89,#00,#a1
	db #88,#1f,#13,#09,#97,#01,#00,#00
	db #88,#1f,#13,#06,#97,#1f,#89,#00
	db #88,#1f,#13,#09,#97,#01,#00,#88
	db #1f,#11,#09,#a3,#97,#07,#00,#00
.l4c68 equ $ + 4
	db #a1,#00,#00,#7f,#92,#8e,#88,#1f
	db #21,#08,#a1,#10,#10,#10,#20,#10
	db #10,#20,#10,#10,#10,#10,#20,#10
.l4c80 equ $ + 4
	db #10,#20,#10,#7f,#92,#8e,#88,#1f
	db #21,#08,#a1,#14,#14,#14,#24,#14
	db #14,#24,#14,#14,#14,#14,#24,#14
.l4c98 equ $ + 4
	db #14,#24,#14,#7f,#92,#8e,#88,#1f
	db #21,#08,#a1,#12,#12,#12,#22,#12
	db #12,#22,#12,#12,#12,#12,#22,#12
.l4cb0 equ $ + 4
	db #12,#22,#12,#7f,#92,#8e,#88,#1f
	db #21,#08,#a1,#0b,#0b,#0b,#1b,#0b
	db #0b,#1b,#0b,#0b,#0b,#0b,#1b,#0b
.l4cc8 equ $ + 4
	db #0b,#1b,#0b,#7f,#92,#8e,#88,#1f
	db #21,#08,#a1,#07,#07,#07,#17,#07
	db #07,#17,#07,#07,#07,#07,#17,#07
.l4ce0 equ $ + 4
	db #07,#17,#07,#7f,#92,#8e,#88,#1f
	db #21,#08,#a1,#0a,#0a,#0a,#1a,#0a
	db #0a,#1a,#0a,#0a,#0a,#0a,#1a,#0a
.l4cf8 equ $ + 4
	db #0a,#1a,#0a,#7f,#92,#8e,#88,#1f
	db #21,#08,#a1,#09,#09,#09,#19,#09
	db #09,#19,#09,#09,#09,#09,#19,#09
.l4d10 equ $ + 4
	db #09,#19,#09,#7f,#92,#8e,#88,#1f
	db #11,#08,#a1,#08,#08,#08,#18,#08
	db #08,#18,#08,#08,#08,#08,#18,#08
.l4d28 equ $ + 4
	db #08,#18,#08,#7f,#8f,#92,#a1,#88
	db #1f,#13,#08,#00,#00,#00,#10,#00
	db #00,#10,#00,#00,#00,#00,#10,#00
.l4d40 equ $ + 4
	db #00,#10,#00,#7f,#92,#8e,#88,#1f
	db #61,#0a,#b3,#34,#a3,#32,#a1,#34
	db #32,#a3,#34,#b3,#37,#a3,#34,#a1
	db #30,#34,#a3,#30,#b3,#29,#a3,#29
	db #a1,#30,#29,#a3,#27,#af,#24,#88
	db #1f,#21,#0a,#a0,#24,#27,#30,#34
	db #27,#30,#34,#37,#30,#34,#37,#40
.l4d79 equ $ + 5
	db #34,#37,#40,#44,#7f,#92,#8e,#88
	db #1f,#21,#08,#a1,#40,#3b,#3b,#40
	db #3b,#34,#3b,#34,#40,#3b,#3b,#40
.l4d91 equ $ + 5
	db #3b,#34,#34,#3b,#7f,#92,#8e,#88
	db #1f,#21,#08,#a1,#40,#39,#39,#40
	db #39,#32,#39,#32,#40,#39,#39,#40
.l4da9 equ $ + 5
	db #39,#32,#32,#39,#7f,#92,#8e,#88
	db #1f,#21,#08,#a1,#40,#36,#36,#40
	db #36,#2b,#36,#2b,#40,#36,#36,#40
.l4dc1 equ $ + 5
	db #36,#2b,#2b,#36,#7f,#92,#8e,#88
	db #1f,#21,#08,#a1,#40,#3b,#3b,#40
	db #3b,#37,#3b,#37,#40,#3b,#3b,#40
.l4dd9 equ $ + 5
	db #3b,#37,#37,#3b,#7f,#92,#8e,#88
	db #1f,#21,#08,#a1,#40,#3b,#4b,#40
	db #3b,#46,#4b,#36,#40,#3b,#3b,#40
.l4df1 equ $ + 5
	db #3b,#36,#46,#4b,#7f,#92,#8e,#88
	db #1f,#13,#08,#a1,#40,#40,#40,#50
	db #40,#40,#50,#40,#40,#40,#40,#50
.l4e09 equ $ + 5
	db #40,#40,#50,#40,#7f,#92,#8e,#88
	db #1f,#11,#08,#a1,#33,#33,#33,#38
	db #38,#38,#3b,#3b,#43,#3b,#38,#3b
	db #39,#38,#39,#39,#7f
.l4e21
	dw l4b8c,l4bd5,l4b8c,l4c27
	dw #0000
.l4e2b
	dw l4c68,l4c68,l4c68,l4c68
	dw l4c68,l4c68,l4c68,l4c68
	dw l4c68,l4c68,l4c68,l4c68
	dw l4c68,l4c68,l4c68,l4c68
.l4e4b
	dw l4c80,l4c98,l4cb0,l4cc8
	dw l4c80,l4c98,l4cb0,l4cb0
	dw l4c68,l4c68,l4c68,l4c68
	dw l4c68,l4c68,l4c68,l4c68
	dw l4c68,l4c68,l4c68,l4c68
	dw l4c80,l4c98,l4cb0,l4cc8
	dw l4c80,l4c98,l4cb0,l4cb0
.l4e83
	dw l4c68,l4cb0,l4ce0,l4cf8
	dw l4c68,l4cb0,l4ce0,l4cf8
	dw l4d10,l4d10,l4d10,l4d10
	dw l4c68,l4cb0,l4ce0,l4cf8
	dw #0000
.l4ea5
	dw l4d28,l4d28,l4d28,l4d28
	dw l4d40,l4d40,l4d28,l4d28
.l4eb9 equ $ + 4
	dw l4d28,l4d28,l4d79,l4d91
	dw l4da9,l4dc1,l4d79,l4d91
	dw l4da9,l4dd9,l4d28,l4d28
	dw l4d28,l4d28,l4d40,l4d40
	dw l4d79,l4d91,l4da9,l4dc1
	dw l4d79,l4d91,l4da9,l4dd9
.l4ee5
	dw l4df1,l4df1,l4df1,l4df1
	dw l4df1,l4df1,l4df1,l4df1
	dw l4e09,l4e09,l4e09,l4e09
	dw l4df1,l4df1,l4df1,l4df1
	dw #0000
.l4f07
	dw l4cc8,#0000
.l4f0b
	push bc
	push de
	ld e,b
	ld b,#f4
	out (c),c
	push bc
	ld bc,#f600
	out (c),c
	ld a,#c0
	out (c),a
	nop
	nop
	out (c),c
	pop bc
	out (c),e
	push bc
	ld bc,#f600
	add a
	out (c),a
	nop
	nop
	out (c),c
	pop bc
	pop de
	pop bc
	ret
.l4f32
	cp #7e
	jp z,l49b0
	ld b,a
	and #0f
	add a
	ld d,#00
	ld e,a
	ld hl,l47d4
	add hl,de
	ld de,l47c5
	ld c,#ff
	ldi
	ldi
	ld a,b
	ld hl,l47c5
	ld e,(hl)
	inc hl
	ld d,(hl)
.l4f52
	sub #10
	jr c,l4f5c
	srl d
	rr e
	jr l4f52
.l4f5c
	ld (hl),d
	dec hl
	ld (hl),e
	ret

	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #c8,#d2,#6d,#f2,#6d,#12,#6e,#32
	db #6e,#0a,#45,#52,#6e,#66,#6e,#7a
	db #6e,#8e,#6e,#10,#48,#d2,#6d,#f2
	db #6d,#12,#6e,#32,#6e,#01,#00,#02
	db #00,#02,#08,#02,#18,#01,#18,#00
	db #18,#00,#08,#00,#00,#00,#00,#01
	db #03,#02,#11,#11,#11,#11,#11,#00
	db #11,#00,#33,#33,#33,#33,#33,#00
	db #33,#00,#22,#11,#22,#11,#22,#11
	db #22,#00,#22,#22,#22,#22,#22,#22
	db #55,#00,#00,#00,#00,#00,#11,#22
	db #00,#88,#00,#00,#00,#88,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#22,#00,#00,#00,#22,#44,#88
	db #00,#00,#00,#00,#00,#11,#33,#22
	db #88,#88,#00,#00,#88,#88,#00,#00
	db #00,#80,#40,#c0,#20,#a0,#60,#e0
	db #10,#90,#50,#d0,#30,#b0,#70,#f0
	db #08,#88,#48,#c8,#28,#a8,#68,#e8
	db #18,#98,#58,#d8,#38,#b8,#78,#f8
	db #04,#84,#44,#c4,#24,#a4,#64,#e4
	db #14,#94,#54,#d4,#34,#b4,#74,#f4
	db #0c,#8c,#4c,#cc,#2c,#ac,#6c,#ec
	db #1c,#9c,#5c,#dc,#3c,#bc,#7c,#fc
	db #02,#82,#42,#c2,#22,#a2,#62,#e2
	db #12,#92,#52,#d2,#32,#b2,#72,#f2
	db #0a,#8a,#4a,#ca,#2a,#aa,#6a,#ea
	db #1a,#9a,#5a,#da,#3a,#ba,#7a,#fa
	db #06,#86,#46,#c6,#26,#a6,#66,#e6
	db #16,#96,#56,#d6,#36,#b6,#76,#f6
	db #0e,#8e,#4e,#ce,#2e,#ae,#6e,#ee
	db #1e,#9e,#5e,#de,#3e,#be,#7e,#fe
	db #01,#81,#41,#c1,#21,#a1,#61,#e1
	db #11,#91,#51,#d1,#31,#b1,#71,#f1
	db #09,#89,#49,#c9,#29,#a9,#69,#e9
	db #19,#99,#59,#d9,#39,#b9,#79,#f9
	db #05,#85,#45,#c5,#25,#a5,#65,#e5
	db #15,#95,#55,#d5,#35,#b5,#75,#f5
	db #0d,#8d,#4d,#cd,#2d,#ad,#6d,#ed
	db #1d,#9d,#5d,#dd,#3d,#bd,#7d,#fd
	db #03,#83,#43,#c3,#23,#a3,#63,#e3
	db #13,#93,#53,#d3,#33,#b3,#73,#f3
	db #0b,#8b,#4b,#cb,#2b,#ab,#6b,#eb
	db #1b,#9b,#5b,#db,#3b,#bb,#7b,#fb
	db #07,#87,#47,#c7,#27,#a7,#67,#e7
	db #17,#97,#57,#d7,#37,#b7,#77,#f7
	db #0f,#8f,#4f,#cf,#2f,#af,#6f,#ef
	db #1f,#9f,#5f,#df,#3f,#bf,#7f,#ff
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #11,#11,#11,#11,#11,#11,#11,#11
	db #11,#11,#11,#11,#11,#11,#11,#11
	db #22,#22,#22,#22,#22,#22,#22,#22
	db #22,#22,#22,#22,#22,#22,#22,#22
	db #33,#33,#33,#33,#33,#33,#33,#33
	db #33,#33,#33,#33,#33,#33,#33,#33
	db #44,#44,#44,#44,#44,#44,#44,#44
	db #44,#44,#44,#44,#44,#44,#44,#44
	db #55,#55,#55,#55,#55,#55,#55,#55
	db #55,#55,#55,#55,#55,#55,#55,#55
	db #66,#66,#66,#66,#66,#66,#66,#66
	db #66,#66,#66,#66,#66,#66,#66,#66
	db #77,#77,#77,#77,#77,#77,#77,#77
	db #77,#77,#77,#77,#77,#77,#77,#77
	db #88,#88,#88,#88,#88,#88,#88,#88
	db #88,#88,#88,#88,#88,#88,#88,#88
	db #99,#99,#99,#99,#99,#99,#99,#99
	db #99,#99,#99,#99,#99,#99,#99,#99
	db #aa,#aa,#aa,#aa,#aa,#aa,#aa,#aa
	db #aa,#aa,#aa,#aa,#aa,#aa,#aa,#aa
	db #bb,#bb,#bb,#bb,#bb,#bb,#bb,#bb
	db #bb,#bb,#bb,#bb,#bb,#bb,#bb,#bb
	db #cc,#cc,#cc,#cc,#cc,#cc,#cc,#cc
	db #cc,#cc,#cc,#cc,#cc,#cc,#cc,#cc
	db #dd,#dd,#dd,#dd,#dd,#dd,#dd,#dd
	db #dd,#dd,#dd,#dd,#dd,#dd,#dd,#dd
	db #ee,#ee,#ee,#ee,#ee,#ee,#ee,#ee
	db #ee,#ee,#ee,#ee,#ee,#ee,#ee,#ee
	db #ff,#ff,#ff,#ff,#ff,#ff,#ff,#ff
	db #ff,#ff,#ff,#ff,#ff,#ff,#ff,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff
	db #00,#11,#22,#33,#44,#55,#66,#77
	db #88,#99,#aa,#bb,#cc,#dd,#ee,#ff

;org #7387	; init
;ld a,#01
;call #43f8

.game_name
	db "Mission Omega",0
.game_year
	db "1986",0
.game_publisher
	db "Mind Games",0
.music_author
	db "",0
.music_comment
	db "",0

	read "music_end_v1_0.asm"
